﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.Election.Supporter
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.Localization;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.Election
{
  public class Supporter
  {
    [SaveableField(0)]
    public readonly Clan Clan;
    [SaveableField(1)]
    public Supporter.SupportWeights SupportWeight;
    [SaveableField(2)]
    public string ImagePath;

    internal static void AutoGeneratedStaticCollectObjectsSupporter(
      object o,
      List<object> collectedObjects)
    {
      ((Supporter) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      collectedObjects.Add((object) this.Clan);
    }

    internal static object AutoGeneratedGetMemberValueClan(object o)
    {
      return (object) ((Supporter) o).Clan;
    }

    internal static object AutoGeneratedGetMemberValueSupportWeight(object o)
    {
      return (object) ((Supporter) o).SupportWeight;
    }

    internal static object AutoGeneratedGetMemberValueImagePath(object o)
    {
      return (object) ((Supporter) o).ImagePath;
    }

    public bool IsPlayer => this.Clan.Leader.IsHumanPlayerCharacter;

    public TextObject Name => this.Clan.Leader.Name;

    public TextObject EncyclopediaLinkWithName => this.Clan.Leader.EncyclopediaLinkWithName;

    public Supporter(Clan clan)
    {
      this.Clan = clan;
      this.SupportWeight = Supporter.SupportWeights.StayNeutral;
    }

    public override bool Equals(object obj)
    {
      return obj is Supporter supporter && supporter.Clan == this.Clan;
    }

    public override int GetHashCode() => base.GetHashCode();

    public enum SupportWeights
    {
      Choose,
      StayNeutral,
      SlightlyFavor,
      StronglyFavor,
      FullyPush,
    }
  }
}
